import java.util.Arrays;
public class t3 {
    public static void main(String[] args) {
        String str = "";
        String[] arr = str.split("");
        boolean falg =true;
        int[] max = new int [arr.length];
        for (int i = 0; i <= arr.length-1; i++) {
            falg =true;
       aa:     for (int j = i + 1; j <= arr.length - 1; j++) {
                if( arr[i].equals(arr[j]) ){
                    max[i]= j-i;
                   break;
                }else {
                    for(int k = i+1; k<j;k++){
                        if( arr[k].equals(arr[j]) ){
                           max[i]  =j-i;
                           falg =false;
                            break aa;

                        }
                    }
                }
           if(falg==true){
               max[i] = j-i+1;
           }
            }
            if(i==arr.length-1){
                max[i] = 1;
            }
            /*if(str == ""){
                max[i] =0;
            }*/
            //System.out.println(max[i]);
        }
        System.out.println(Arrays.toString(max) );
        int max1 = max[0];
        for(int i =1; i<=max.length-1;i++){
            if(max1<=max[i]){
                max1 = max[i];
            }

        }
        System.out.println(max1);



    }
}







